home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 65.zip
/
BS1 part 65
/
Math Visin v2.1 disk 1.adf
/
Arexx.WB
/
Sequence
< prev
next >
Wrap
Text File
|
1992-02-12
|
2KB
|
51 lines
/* Sequence. A generic ARexx macro to run a series of ARexx macros 8-Mar-90 dh
Click once on this program, hold down the shift key, click on the desired
macros to run, and double-click on the last one.
This macro was designed for sequencing convolutions, but may be used
for other processes as well. Note that all the arguments should be complete
filenames, starting with a volume.
---------------------------------------------------------------------------- */
OPTIONS RESULTS
OPTIONS FAILAT 1
SIGNAL ON ERROR
NUMERIC DIGITS 14
PARSE ARG CommandLine /* break command line into filename array */
Delim = d2c(10)
TotalFilenames = 0
DO FOREVER
position = POS(Delim,CommandLine||Delim)
IF (position<2) THEN LEAVE
TotalFilenames = TotalFilenames+1
Filename.TotalFilenames = Left(CommandLine,position-1)
CommandLine = SubStr(CommandLine,position+1)
END
DO i = 1 to TotalFileNames /* run each macro in turn */
SAY Filename.i
CALL SeparateFilename( Filename.i )
PARSE VAR RESULT Filename Path .
OldDir = PRAGMA( 'Directory', Path )
INTERPRET CALL Filename
END
EXIT
/*---------------------------- SeparateFilename -------------------------- */
/* given a complete path and filename, return filename and path separately. */
SeparateFilename: PROCEDURE
ARG allpath
T = LASTPOS("/",AllPath)
IF (T~=0) THEN DO; RETURN SubStr(AllPath, T+1) LEFT(AllPath, T-1); END
ELSE
DO
T = Index(AllPath, ":")
IF (T~=0) THEN DO; RETURN SubStr(AllPath,T+1) LEFT(AllPath,T); END
ELSE RETURN AllPath
END